Skip to content

Fix memory size accounting for grouped median and avg#23357

Open
lyne7-sc wants to merge 1 commit into
apache:mainfrom
lyne7-sc:fix/aggregate-size-estimation
Open

Fix memory size accounting for grouped median and avg#23357
lyne7-sc wants to merge 1 commit into
apache:mainfrom
lyne7-sc:fix/aggregate-size-estimation

Conversation

@lyne7-sc

@lyne7-sc lyne7-sc commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

  • Closes #.

Rationale for this change

AvgGroupsAccumulator stores sums in Vec<T::Native>, and MedianGroupsAccumulator stores grouped values in Vec<Vec<T::Native>>, but their size() implementations used size_of::<T>() when accounting for those allocations.

This underreports memory usage for those grouped aggregate buffers.

What changes are included in this PR?

  • Use size_of::<T::Native>() for grouped avg sum storage.
  • Use size_of::<T::Native>() for grouped median value storage.

Are these changes tested?

Existing aggregate tests pass.

Are there any user-facing changes?

No. This only affects internal memory accounting.

@github-actions github-actions Bot added the functions Changes to functions implementation label Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

functions Changes to functions implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant